﻿<!DOCTYPE HTML>
<html>
<head>
	<title>ChatEase.JS</title>
	
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
	<meta content="yes" name="apple-mobile-web-app-capable"/>
	<meta content="yes" name="apple-touch-fullscreen"/>
	<meta content="telephone=no,email=no" name="format-detection"/>
	<meta name="App-Config" content="fullscreen=yes, useHistoryState=yes, transition=yes"/>
	
	<style type='text/css' media='screen'>
html {
	font-size: 10px;
}

body {
	margin: 0;
	font-family: Karbon, Helvetica, Arial, sans-serif;
	font-style: normal;
	font-size: 14px;
	line-height: 18px;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	color: #E6E6E6;
	background-color: #303030;
}

.ol-status {
	margin: 40px auto 10px;
}
.ol-status ~ #playwrap, .ol-status ~ #chatwrap {
	margin: 0 auto;
}
	</style>
	
	<!--<script type='text/javascript' src='js/bscroll.min.js'></script>-->
	<script type='text/javascript' src='js/bscroll.js'></script>
	<script type='text/javascript' src='js/keywords.js'></script>
	
	<!--<script type='text/javascript' src='../chatease.js'></script>-->
	<script type='text/javascript' src='../cn/studease/chatease.js'></script>
	<script type='text/javascript' src='../cn/studease/utils/chatease.utils.js'></script>
	<script type='text/javascript' src='../cn/studease/utils/chatease.utils.crypt.js'></script>
	<script type='text/javascript' src='../cn/studease/utils/chatease.utils.css.js'></script>
	<script type='text/javascript' src='../cn/studease/utils/chatease.utils.filter.js'></script>
	<script type='text/javascript' src='../cn/studease/events/chatease.events.js'></script>
	<script type='text/javascript' src='../cn/studease/events/chatease.events.eventdispatcher.js'></script>
	<script type='text/javascript' src='../cn/studease/utils/chatease.utils.timer.js'></script>
	<script type='text/javascript' src='../cn/studease/api/chatease.api.js'></script>
	<script type='text/javascript' src='../cn/studease/core/chatease.core.js'></script>
	<script type='text/javascript' src='../cn/studease/core/chatease.core.states.js'></script>
	<script type='text/javascript' src='../cn/studease/core/chatease.core.message.js'></script>
	<script type='text/javascript' src='../cn/studease/core/skins/chatease.core.skins.js'></script>
	<script type='text/javascript' src='../cn/studease/core/skins/chatease.core.skins.def.js'></script>
	<script type='text/javascript' src='../cn/studease/core/skins/chatease.core.skins.mobile.js'></script>
	<script type='text/javascript' src='../cn/studease/core/renders/chatease.core.renders.js'></script>
	<script type='text/javascript' src='../cn/studease/core/renders/chatease.core.renders.def.js'></script>
	<script type='text/javascript' src='../cn/studease/core/renders/chatease.core.renders.none.js'></script>
	<script type='text/javascript' src='../cn/studease/core/chatease.core.entity.js'></script>
	<script type='text/javascript' src='../cn/studease/core/chatease.core.model.js'></script>
	<script type='text/javascript' src='../cn/studease/core/chatease.core.view.js'></script>
	<script type='text/javascript' src='../cn/studease/core/chatease.core.controller.js'></script>
	<script type='text/javascript' src='../cn/studease/embed/chatease.embed.js'></script>
	<script type='text/javascript' src='../cn/studease/embed/chatease.embed.config.js'></script>
	<script type='text/javascript' src='../cn/studease/embed/chatease.embed.embedder.js'></script>
</head>
<body ontouchstart=''>
	<div class='ol-status' style='width: 100%; max-width: 640px;'>
		<label>Online: </label>
		<span id='ol-users'>0</span>
	</div>
	<div id='chatwrap' style='width: 100%; height: 400px; max-width: 640px;'>
		<div id='chat'></div>
	</div>
	
	<script type="text/javaScript">
		var users = document.getElementById('ol-users');
		var events = chatease.events;
		
		var chat = chatease('chat');
		chat.addEventListener(events.CHATEASE_INFO, onInfo);
		chat.addEventListener(events.CHATEASE_MESSAGE, onMessage);
		chat.addEventListener(events.CHATEASE_USER, onUser);
		chat.addEventListener(events.CHATEASE_EXTERN, onExtern);
		chat.addEventListener(events.CHATEASE_CLOSE, onClose);
		chat.setup({
			url: 'ws://192.168.4.248/chat/001' + window.location.search,
			width: 640,
			height: 400,
			keywords: keywords,
			maxretries: 0,
			smoothing: false,
			debug: true,
			render: {
				name: 'def',
				title: 'CHATEASE ' + chatease.version,
				swf: '../swf/chatease.swf'
			},
			skin: {
				name: chatease.utils.isMobile() ? 'mobile' : 'def'
			}
		});
		
		function onInfo(e) {
			users.innerText = e.channel.total;
		}
		
		function onMessage(e) {
			//console.log(e.user.name + ': ' + e.data);
		}
		
		function onUser(e) {
			users.innerText = e.channel.total;
		}
		
		function onExtern(e) {
			console.log(e.data);
		}
		
		function onClose(e) {
			users.innerText = 0;
		}
	</script>
</body>
</html>